//
//  SSMineInfoViewController.m
//  starspaceVR
//
//  Created by 曹端芹 on 17/10/10.
//  Copyright © 2017年 starspace. All rights reserved.
//

#import "SSMineInfoViewController.h"

#import "SSUserInfoModel.h"
#import "SSUserInfoManager.h"
#import "SSSexPickView.h"

@interface SSMineInfoViewController () <UITextFieldDelegate,SSSexPickViewDelegate>
@property (weak, nonatomic) IBOutlet UITextField *nickNameTF;
@property (weak, nonatomic) IBOutlet UITextField *phoneTF;
@property (weak, nonatomic) IBOutlet UITextField *emailTF;
@property (weak, nonatomic) IBOutlet UITextField *QQTF;

@property (weak, nonatomic) IBOutlet UILabel *birthdayL;
@property (weak, nonatomic) IBOutlet UILabel *sexL;



@end

@implementation SSMineInfoViewController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [[IQKeyboardManager sharedManager] setEnableAutoToolbar:NO];
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"个人信息";
    [self setup];
}

- (void) setup {
    
    SSUserInfoModel *userInfo = [[SSUserInfoManager sharedManager] currentUserInfo];
    self.nickNameTF.text = userInfo.nickName;
    self.phoneTF.text = userInfo.mobile;
    self.emailTF.text = userInfo.email;
    self.QQTF.text = userInfo.qq;
    self.sexL.text = userInfo.sex;
    self.birthdayL.text = userInfo.birthday;
    
    
   
  

}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [[IQKeyboardManager sharedManager] setEnableAutoToolbar:YES];

}
- (IBAction)sexTap:(UITapGestureRecognizer *)sender {
    [self.view endEditing:YES];
    self.sexL.text = @"保密";
    SSSexPickView *sexPickView = [[SSSexPickView alloc] initWithFrame:self.view.bounds];
    sexPickView.delegate = self;
    [self.view addSubview:sexPickView];
    
}

- (void)selectedStringInPickView:(NSString *)selectedStr {
    
    NSLog(@"%@",selectedStr);
    self.sexL.text = selectedStr;

}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
